package com.cc.visitor.config;

import com.mybatisflex.core.FlexGlobalConfig;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;

/**
 * @author chanchaw
 * @create 2024-09-18 19:21
 */
@Configuration
public class MybatisFlexConfig {
    @PostConstruct
    public void init(){
        FlexGlobalConfig globalConfig = FlexGlobalConfig.getDefaultConfig();
        FlexGlobalConfig.getDefaultConfig().setLogicDeleteColumn("is_delete");
        //设置数据库正常时的值
        globalConfig.setNormalValueOfLogicDelete(0);
        //设置数据已被删除时的值
        globalConfig.setDeletedValueOfLogicDelete(1);
    }

}
